# -*- coding: utf-8 -*-
"""
@Time ： 2023/1/1 16:04
@Auth ： jiraWu
@File ：requests_代理.py
@IDE ：PyCharm
@Motto:人生苦短，我学Python

"""
import requests

url = "https://www.baidu.com/s?"

headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
    ,
    "cookie": "BIDUPSID=B57B32E6C59F55EDF52BBB2A52D097F3; PSTM=1654247182; BAIDUID=B57B32E6C59F55EDABB894F9521AB43C:FG=1; BD_UPN=12314753; BDSFRCVID=0_POJexroG0wKK3j4jhd-_t6-gKK0gOTDYLEOwXPsp3LGJLVgrUBEG0Pt_U-mEt-J8jwogKK3gOTH4DF_2uxOjjg8UtVJeC6EG0Ptf8g0M5; H_BDCLCKID_SF=JnAfoKK2fIt3qJTph47hqR-8MxrK2JT3KC_X3b7Ef-O_Kq7_bf--Dx_ALJ5vJ-Tx-GRJsx72Jj6JOnnn3bjxy5K_hpQ73R5B3b6NBJOM5JTOeJTHQT3m3UrbbN3i-xr2MIv3Wb3cWKOJ8UbS253PBTD02-nBat-OQ6npaJ5nJq5nhMJmb67JD-50eGK8t5LHtbPjV-582R7_KJO1MtbOq4IOqxby26PHa-j9aJ5nJD_MhIn25TJ8j-IS2mcd-TKLQgrX_nbmQpP-HJ7gh4RpMUvQ3f-fX45rJNvhKl0MLU3Ybb0xyUQDMf73WxnMBMPe52OnaIbg3fAKftnOM46JehL3346-35543bRTLnLy5KJtMDFRjTLhj5ObeU5eetjK2CntsJOOaCk2_UJOy4oWK441DhJiB5JBJIQ30T67bILVepvoD-Jc3M04X-o9-hvT-54e2p3FBUQJqx5tQft20b0m3ecL0R0LWJbBLb7jWhk5ep72y5OUQlRX5q79atTMfNTJ-qcH0KQpsIJM5-DWbT8IjH62btt_tRIHoCbP; kleck=82be2aa6738f0777282f98b129d598b2; BA_HECTOR=858g0g0g8080248lahah0l6f1hr2eb91j; BAIDUID_BFES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E1OGU5ZTIwYzYxNWExY2MyODI1ODllNGEzNDljZTAzNDY4MDg2YWUzMDZjOTc5MTJmMTQxOGYwZTA1Y2VmMmYwMTA0YzMwNmYyYTMyZjg4ODMyMzRjMjgzNDRiMzk5MjcwYWNhYmVhZWZiNDg3MTk4N2JhY2UyMjM0ZThjOWNjZTFhZWE2MjVjZTM0ZWE5MmYyOA=="
}
params = {
    "wd": "ip"
}
proxies = {
    "https": "222.74.73.202:42055"
}
resp = requests.get(url=url, params=params, headers=headers, proxies=proxies)
print(resp.text)
with open('daili.html', 'w', encoding="utf-8") as f:
    f.write(resp.text)
